var app = getApp();

Page({
  data: {},
  onLoad: function(a) {
    var that = this
    var beizhu = a.beizhu
    var id = a.id
    that.setData({
      beizhu: beizhu,
      id: id,
      u_id: a.u_id
    })
  },
  input: function(a) {
    console.log(a.detail.value), this.setData({
      wznameModifier: a.detail.value
    });
  },
  onClock: function(e) {
    var that = this
    var id = that.data.id
    var u_id = that.data.u_id
    var beizhu = that.data.wznameModifier
    app.util.request({
      'url': 'entry/wxapp/Docuser.addfenzu',
      data: {
        id: id,
        u_id: u_id,
        beizhu: beizhu,
        op: 'xiugaibeizhu'
      },
      success: function(res) {
        console.log(res)
        var pages = getCurrentPages();
        var prevPage = pages[pages.length - 2];
        prevPage.setData({
          type: 1
        })
        wx.showToast({
          title: "修改备注成功",
          icon: "none",
          duration: 1e3,
          success: function() {
            setTimeout(function() {
              wx.navigateBack({
                delta: 1
              })
            }, 2000)
          }
        });
      }
    })
  },
  onShow: function() {}
});